-module('ex_8.4_chomping_final_line_break').

-include_lib("eunit/include/eunit.hrl").

-define(FILENAME, "test/parsing/" ?MODULE_STRING ".yaml").

single_test_() ->
    ?_assertMatch(
      {yamerl_parser,
        {file,?FILENAME},
        [],
        <<>>,
        48,
        true,
        [],
        0,
        49,
        7,
        1,
        false,
        7,
        1,
        utf8,
        false,
        undefined,
        _,
        _,
        [],
        {bcoll,root,0,-1,1,1,-1,1,1},
        false,
        false,
        false,
        [{impl_key,false,false,undefined,undefined,1,1}],
        false,
        false,
        _,
        [],
        0,
        19,
        18,
        undefined,
        undefined,
        _,
        false,
        [],
        [
          {yamerl_stream_end,7,1},
          {yamerl_doc_end,7,1},
          {yamerl_collection_end,7,1,block,mapping},
          {yamerl_scalar,5,7,
            {yamerl_tag,5,7,{non_specific,"!"}},
            block,literal,"text\n"},
          {yamerl_mapping_value,5,5},
          {yamerl_scalar,5,1,
            {yamerl_tag,5,1,{non_specific,"?"}},
            flow,plain,"keep"},
          {yamerl_mapping_key,5,1},
          {yamerl_scalar,3,7,
            {yamerl_tag,3,7,{non_specific,"!"}},
            block,literal,"text\n"},
          {yamerl_mapping_value,3,5},
          {yamerl_scalar,3,1,
            {yamerl_tag,3,1,{non_specific,"?"}},
            flow,plain,"clip"},
          {yamerl_mapping_key,3,1},
          {yamerl_scalar,1,8,
            {yamerl_tag,1,8,{non_specific,"!"}},
            block,literal,"text"},
          {yamerl_mapping_value,1,6},
          {yamerl_scalar,1,1,
            {yamerl_tag,1,1,{non_specific,"?"}},
            flow,plain,"strip"},
          {yamerl_mapping_key,1,1},
          {yamerl_collection_start,1,1,
            {yamerl_tag,1,1,{non_specific,"?"}},
            block,mapping},
          {yamerl_doc_start,1,1,{1,2},_},
          {yamerl_stream_start,1,1,utf8}
        ]
      },
      yamerl_parser:file(?FILENAME)
    ).
